package com.hydong.novatest.fragment

import android.content.Intent
import android.view.LayoutInflater
import android.view.View
import android.widget.Button
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.hydong.novatest.R
import com.hydong.novatest.activity.AirActivity
import com.hydong.novatest.base.BaseFragment
import com.qmuiteam.qmui.widget.QMUITopBarLayout

class HomeFragment : BaseFragment() {

    override fun onCreateView(): View {
        val view = LayoutInflater.from(activity).inflate(R.layout.fragment_home, null)
        initView(view)
        return view
    }

    private fun initView(view: View) {

        var topbar = view.findViewById<QMUITopBarLayout>(R.id.topbar)
        topbar.setTitle("ASIAIR")


        var ivAirGif = view.findViewById<ImageView>(R.id.iv_air_gif)
        Glide.with(activity).load(R.drawable.asi_pi4).asGif().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(ivAirGif)


        var brnConnect = view.findViewById<Button>(R.id.brn_connect)
        brnConnect.setOnClickListener {
            startActivity(Intent(activity, AirActivity::class.java))
        }
    }

}